package org_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 组织-工程车企业经营类别-操作类型
type orgEnginVehBusinessTypeOperType int

var OrgEnginVehBusinessTypeOperType orgEnginVehBusinessTypeOperType

// 新增
func (c *orgEnginVehBusinessTypeOperType) Add() int {
	return 1
}

// 撤销
func (c *orgEnginVehBusinessTypeOperType) Remove() int {
	return 2
}

// 暂停
func (c *orgEnginVehBusinessTypeOperType) Stop() int {
	return 3
}

// 恢复
func (c *orgEnginVehBusinessTypeOperType) Recover() int {
	return 4
}

func (c *orgEnginVehBusinessTypeOperType) ToText(value int) string {
	switch value {

	case 1:
		return "新增"

	case 2:
		return "撤销"

	case 3:
		return "暂停"

	case 4:
		return "恢复"

	}
	return ""
}

func (c *orgEnginVehBusinessTypeOperType) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *orgEnginVehBusinessTypeOperType) ToValue(text string) int {
	switch text {

	case "新增":
		return 1

	case "撤销":
		return 2

	case "暂停":
		return 3

	case "恢复":
		return 4

	}
	return 0
}
